package com.easyaop.api.aopalliance;

import com.easyaop.api.around.Around;
import com.easyaop.api.around.Call;
import com.easyaop.api.join.JoinPoint;
import org.aopalliance.intercept.MethodInterceptor;

public abstract class DefaultMethodInterceptor implements MethodInterceptor, Around {
    @Override
    public Object around(Object target, Object[] args, JoinPoint joinPoint, Call call) throws Exception {
        try {
            return invoke(new DefaultMethodInvocation(target,args,joinPoint,call));
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
}
